import 'package:flutter/material.dart';

class CommonAppBar extends AppBar {
  final bool hiddenBack;
  final Color backgroundColor;
  final Widget title;
  final VoidCallback onPress;
  final List<Widget> actions;

  CommonAppBar(
      {Key key,
      this.backgroundColor = Colors.white,
      this.title,
      this.onPress,
      this.actions,
      this.hiddenBack = true})
      : super(
            key: key,
            leading: !hiddenBack ? IconButton(
                tooltip: '返回',
                icon: Icon(Icons.arrow_back_ios,
                    color: backgroundColor == Colors.blue
                        ? Colors.white
                        : Colors.blue),
                onPressed: onPress) : Container(),
            title: title,
//            elevation: 0,
            backgroundColor: backgroundColor,
            centerTitle: true,
            brightness: Brightness.light,
            actions: actions);
}
